#ifndef SDRAGON_SURFACELIST_H_INCLUDED
#define SDRAGON_SURFACELIST_H_INCLUDED

#include "SDragon_GeneralIncludes.h"

#include "SDR_Window.h"
#include "SDR_Surface.h"
#include "SDR_Button.h"

#include "SDragon_Surface.h"
#include "SDragon_Button.h"

#define SDR_newSurfaceList(surfaceList) SDR_SurfaceList surfaceList = {0}

uint8_t DLL_EXPORT SDR_SurfaceList_save(SDR_Window * window, SDR_SurfaceList * surfaceList);
uint8_t DLL_EXPORT SDR_SurfaceList_back(SDR_Window * window, SDR_SurfaceList * surfaceList);

uint16_t DLL_EXPORT SDR_SurfaceList_addElementAtEnd(SDR_Window * window, SDR_SurfaceType surfaceType, void * element, uint8_t atEnd);
uint8_t DLL_EXPORT SDR_SurfaceList_removeElement(SDR_Window * window, SDR_SurfaceType surfaceType, void * element);
uint8_t DLL_EXPORT SDR_SurfaceList_moveUp(SDR_Window * window, SDR_SurfaceType surfaceType, void * element, uint16_t nbMove);
uint8_t DLL_EXPORT SDR_SurfaceList_moveDown(SDR_Window * window, SDR_SurfaceType surfaceType, void * element, uint16_t nbMove);

uint16_t DLL_EXPORT SDR_SurfaceList_addSurface(SDR_Window * window, SDR_Surface * surface);
uint16_t DLL_EXPORT SDR_SurfaceList_addSurfaceAtBegin(SDR_Window * window, SDR_Surface * surface);
uint8_t DLL_EXPORT SDR_SurfaceList_removeSurface(SDR_Window * window, SDR_Surface * surface);
uint8_t DLL_EXPORT SDR_SurfaceList_moveSurfaceUp(SDR_Window * window, SDR_Surface * surface, uint16_t nbMove);
uint8_t DLL_EXPORT SDR_SurfaceList_moveSurfaceDown(SDR_Window * window, SDR_Surface * surface, uint16_t nbMove);


uint16_t DLL_EXPORT SDR_SurfaceList_addButton(SDR_Window * window, SDR_Button * button);
uint16_t DLL_EXPORT SDR_SurfaceList_addButtonAtBegin(SDR_Window * window, SDR_Button * button);
uint8_t DLL_EXPORT SDR_SurfaceList_removeButton(SDR_Window * window, SDR_Button * button);
uint8_t DLL_EXPORT SDR_SurfaceList_moveButtonUp(SDR_Window * window, SDR_Button * button, uint16_t nbMove);
uint8_t DLL_EXPORT SDR_SurfaceList_moveButtonDown(SDR_Window * window, SDR_Button * button, uint16_t nbMove);


void DLL_EXPORT SDR_SurfaceList_blitElement(SDR_Window * window, SDR_SurfaceListElement * surfaceListElement);
void DLL_EXPORT SDR_SurfaceList_blit(SDR_Window * window);


void DLL_EXPORT SDR_SurfaceList_free(SDR_SurfaceList * surfaceList);
void DLL_EXPORT SDR_SurfaceList_freeElement(SDR_SurfaceListElement * surfaceListElement);

#endif // SDRAGON_SURFACELIST_H_INCLUDED
